#include "login.h"
#include "ui_login.h"
#include "QPainter"
#include "QMessageBox"

Login::Login(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Login)
{
    ui->setupUi(this);
}

Login::~Login()
{
    delete ui;
}

//selfdefinition
void Login::paintEvent(QPaintEvent* event)//作图用函数
{
    QPainter painter(this);
        painter.drawPixmap(0,0,1500,1000,QPixmap(":/scene/nkulbl.jpg"));
}


void Login::on_pushButton_clicked()
{
    /*this->close();
    ptc=new fire;
    ptc->show();*/
    if(1||ui->lineEdit->text()=="nku_lthomework"&&ui->lineEdit_2->text()=="123456")
    {//↑这里有个1，使用时应当删去
        this->close();
        westgp=new Wgate;
        westgbp=new Wgatebtn;
        westgp->show();
        westgbp->show();
    }
    else
    {
        this->close();
        Wgate *Faulse=new Wgate;
        Faulse->show();
        QMessageBox::information(NULL,"FAULT","Please reinput your ID and PW");
    }
}
